<!--待退资保金列表-->
<template>
  <div>
    <f-search-form :more='true' @searchHandler='searchHandler' :tableObj='$refs.table'>
      <f-search-form-item label='业务员' name='saleManName'  />
      <f-search-form-item label='开始日期' type='date' name='beginDate'  />
      <f-search-form-item label='结束日期' type='date' name='endDate' />
    </f-search-form>
    <f-table ref='table' rowKey='orderDetailsId' :tableColumns='columns' :showMultipleBtn='false' :multiple='true' :scroll='{x:true}' :operator='operator' :params='queryParam' :api='api.hyOrderDetails' handler='hyRefundBondTab3PageListHandler'>
      
    </f-table>
    <refund-drawer ref='refundDrawer' @success='onLoad'></refund-drawer>
  </div>
</template>
<script>
import refundDrawer from "./components/refund_drawer.vue"
import api from "../js/api"

export default {
  name: "Tab3",
  components: {
    refundDrawer
  },
  data() {
    let me = this
    //操作按钮
    let operator = []
    operator.push({
      name: "申请退款",
      that: this,
      handler: (table, that) => {
        let selectIds = table.selectedRowKeys
        if (selectIds.length > 0) {
          this.$refs.refundDrawer.showDrawer({
            selectIds: selectIds.join(",")
          })
        } else {
          that.$message.error("请选择退款数据")
        }
      }
    })
    operator.push({
      name: "删除",
      icon: "delete",
      batch: true,
      handler: function(table) {
        table.remove()
      }
    })
    return {
      api: Object.assign(api, this.api),
      processImageVisible: false,
      //列表初始化查询参数
      queryParam: {},
      // 表头
      columns: [
        {
          title: "序号",
          width: "60px",
          align: "center",
          customRender: (text, record, index) => index + 1
        },
        {
          title: "发货日期",
          align: "center",
          width: "100px",
          dataIndex: "sendDate"
        },
        {
          title: "订单编号",
          align: "center",
          width: "100px",
          ellipsis: true,
          dataIndex: "orderNo"
        },
        {
          title: "部门",
          align: "center",
          width: "100px",
          dataIndex: "deptName"
        },
        {
          title: "业务员",
          align: "center",
          width: "100px",
          dataIndex: "saleManName"
        },
        {
          title: "区域",
          align: "center",
          width: "100px",
          dataIndex: "businessCode"
        },
        {
          title: "发货日期",
          align: "center",
          width: "100px",
          ellipsis: true,
          dataIndex: "sendDate"
        },
        {
          title: "商品名称",
          align: "center",
          width: "100px",
          ellipsis: true,
          dataIndex: "drugsName"
        },
        {
          title: "商品规格",
          align: "center",
          width: "100px",
          dataIndex: "drugsSpec"
        }, {
          title: "销售单价",
          align: "center",
          width: "80px",
          dataIndex: "salePrice"
        }, {
          title: "数量",
          align: "center",
          width: "80px",
          dataIndex: "saleNum"
        },
        {
          title: "资保金金额",
          align: "center",
          width: "80px",
          dataIndex: "customBond"
        }
      ],
      operator: operator
    }
  },
  created() {
  },
  methods: {
    onLoad() {
      this.$refs.table.refresh()
    },
    processImg(order) {
      this.processInstanceId = order.processInstanceId
      this.processImageVisible = true
    },
    //打印退款单
    printPayment(record) {
      this.$refs["printModal"].open(record.depositId, 2, "Other")
    }
  }
}
</script>
